/interface bridge
add name=bridge1


/interface ethernet
set [ find default-name=ether1 ] name=ether1-link-vivo
set [ find default-name=ether2 ] name=ether2-rede-local


/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1-link-vivo name=pppoe-cliente password=123 user=cgnat


/ip pool
add name=dhcp_pool1 ranges=192.168.15.2-192.168.15.254


/ip dhcp-server
add address-pool=dhcp_pool1 interface=ether2-rede-local name=dhcp1


/interface bridge port
add bridge=bridge1 disabled=yes interface=ether1-link-vivo
add bridge=bridge1 disabled=yes interface=ether2-rede-local


/ip address
add address=192.168.15.1/24 interface=ether2-rede-local network=192.168.15.0


/ip dhcp-server network
add address=192.168.15.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.15.1


/ip firewall nat
add action=masquerade chain=srcnat comment="NAT DE NAVEGACAO PPPOE" out-interface=pppoe-cliente
add action=masquerade chain=srcnat comment="NAT DE NAVEGACAO DHCP" out-interface=ether1-link-vivo


/system identity
set name=003-CPE_VIVO


/system note
set show-at-login=no


/system script
add dont-require-permissions=no name="ATIVAR MODO BRIDGE" owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#ATIVA O MODO BRIDGE\r\
    \n/interface/bridge/port enable [find]\r\
    \n\r\
    \n/interface/pppoe-client/disable pppoe-cliente\r\
    \n\r\
    \n/ip/dhcp-server/disable dhcp1\r\
    \n"
add dont-require-permissions=no name="ATIVAR MODO ROTEADO" owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#ATIVA O MODO ROTEADO\r\
    \n\r\
    \n/interface/bridge/port disable [find]\r\
    \n\r\
    \n/interface/pppoe-client/enable pppoe-cliente\r\
    \n\r\
    \n/ip/dhcp-server/enable dhcp1"


/tool romon
set enabled=yes secrets=cursomikrotik
